package com.sharer.last.controller;

import com.sharer.last.base.constant.CommonConstant;
import com.sharer.last.base.model.R;
import com.sharer.last.model.dto.user.UserUpdateDTO;
import org.springframework.web.bind.annotation.*;
import com.sharer.last.service.UserService;

import javax.annotation.Resource;

/**
 * 账号后台管理
 *
 * @ClassName AccountAdminController
 * @Author wangjin
 * @Date 2023/5/5 21:03
 * @Description
 * @Version 1.0
 */
@RestController
@RequestMapping(CommonConstant.BLOG_ADMIN_API + "/account")
public class AccountAdminController {
    @Resource
    UserService userService;

    /**
     * 账号密码修改
     */
    @PostMapping("/update")
    public R account(@RequestBody UserUpdateDTO user) {
        userService.updateAccount(user);
        return R.handle();
    }
}
